home *** CD-ROM | disk | FTP | other *** search
/ Aminet 33 / Aminet 33 - October 1999.iso / Aminet / dev / cross / ava-0.2.5.lha / ava-0.2.5 / examples / example1.s < prev    next >
Encoding:
Text File  |  1999-03-23  |  411 b   |  33 lines

  1. /*
  2.   example1.s
  3.  
  4.   Compile with -T option.
  5.  
  6.   Simple example of code.
  7.   Uros Platise (c) 1999
  8. */
  9.     seg removable flash.code
  10.  
  11.     push r0 push r1 push r2 push r3 push r4
  12.     ldi r16,12<<1
  13.     ldi r16,$100-1
  14.     clr r0
  15.  
  16. #define p    2
  17. #define q    3
  18.  
  19.     sts 0,r31
  20.     st Z,r0
  21.     st Z+,r4
  22.     std Z+q,r3
  23. public here:
  24.     ld r2,Z
  25.     ld r3,Z+
  26.     ldd r4,Z+p
  27.  
  28.     seg eeprom
  29.     ldi r16,0
  30.      
  31.     seg flash
  32.     brmi here /* this code will be put before flash.code */
  33.